<?php
/*
+--------------------------------------------------------------------------
|   phpBIZ v3.0  full version
|   ========================================
|   by taft@wjl.cn yejun@wjl.cn
|   http://www.phpbiz.cn http://www.wjl.cn
|   all rights reserved
+---------------------------------------------------------------------------
|
|   > 最后修改日期：2005-4-30 2006-2-8
|
+--------------------------------------------------------------------------
*/
!class_exists('Debug') && exit('Forbidden');
$idx = new ListMessage;
class ListMessage
{
	function ListMessage()
	{
		global $INCOME,$BIZ,$DB,$INFO_NAME;

		define("PAGE_NUM",30);
		$cid=intval($INCOME[cid]);
		$DB -> db_query("SELECT count(*) as count  FROM biz_info WHERE info_type=".$cid);
		$row_count = $DB -> db_fetch_row();
		$start = $INCOME['st'] ? intval( $INCOME['st'] ) : 0;
		if ($row_count['count'] < 1)
				$BIZ->error("没有从数据库中返回任何匹配。","");
		$pages = $BIZ->build_pagelinks( array('TOTAL_POSS'  => $row_count['count'],
											   'PER_PAGE'    => PAGE_NUM,
											   'CUR_ST_VAL'  => $start,
											   'L_SINGLE'    => "一页",
											   'L_MULTI'     => "页：",
											   'BASE_URL'    => $this->base_url."?act=ListM&code={$INCOME['code']}&cid={$cid}"
											   )
											);
		

		$query = "SELECT * FROM biz_info WHERE info_type=".$cid." ORDER BY info_active_time DESC LIMIT $start,".PAGE_NUM;
		$DB -> db_query( $query );
		while( $r = $DB -> db_fetch_row() )
		{
			$tm = date("Y-m-d H:i",$r['info_active_time']);
			$mlist[] = array( $r['id'],$r['info_title'],$tm );
		}
		$BIZ -> assign("mlist",$mlist);
		$BIZ -> assign("pages",$pages);
		$BIZ -> assign("type",$INFO_NAME[$cid]);
		$BIZ -> output("ListM.tpl");
	}
}

?>